/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-10-19
 * Time: 15:42
 */
import java.applet.* ;
import java.awt.* ;
import java.awt.event.* ;
public class getDouble extends Applet implements ActionListener {
    Label prompt;
    TextField input;
    double d = 0.0;

    public void init() {
        prompt = new Label("Input a double varible: ");
        input = new TextField(6);

        add(prompt);
        add(input);

        input.addActionListener(this);
    }

    public void paint(Graphics g) {
        g.drawString("You input data: " +d, 10,50);
    }

    public void actionPerformed(ActionEvent e) {
        d = Double.valueOf(input.getText()).doubleValue();
        repaint();
    }

    public static void main(String[] args) {

    }
}